import QtQuick 2.0

Rectangle{
    id: root
    width: 300
    height: 180
    color: "transparent"
    property color majorColorDeep: "#2299bb"

    Rectangle{
        id:title
        width: parent.width
        height: parent.height
        color: majorColorDeep
        anchors.top: parent.top
        anchors.topMargin: 0
        Text{
            text: "请登录："
            color: "white"
            anchors.right: parent.right
            anchors.left: parent.left
            font.pointSize: 30
        }
    }

    Rectangle{
        id: rectangle
        width: parent.width
        height: 70
        color: "#e98585"
        anchors.top: parent.top
        anchors.topMargin: 60
        radius: 10
        TextInput{
            id:text_secret
            anchors.verticalCenter: parent.verticalCenter
            anchors.right: parent.right
            anchors.left: parent.left
            font.pointSize: 30
            echoMode: TextInput.Password
            onAccepted: acceptInput()
        }
        onVisibleChanged:
        {
            if(visible) $sqlMcRecorder.qml_arouseKeyboard()
        }
    }

    EXC_Normal_BtnUncheckStyle {
        id: eXC_Normal_BtnUncheckStyle
        width: 120
        anchors.left: parent.left
        nameText: qsTr("确定")
        anchors.bottom: parent.bottom
        onClicked: acceptInput()
    }

    EXC_Normal_BtnUncheckStyle {
        width: 120
        anchors.right: parent.right
        nameText: qsTr("取消")
        anchors.bottom: parent.bottom
        onClicked: {
            root.visible = false
        }
    }
    function acceptInput()
    {
        if(text_secret.text==="kinte") $sqlMcRecorder.qml_setOperaterMode(50)
        else if(text_secret.text==="EXC9200"||text_secret.text==="exc9200"||text_secret.text==="9200") $sqlMcRecorder.qml_setOperaterMode(90)
        else if(text_secret.text==="cei") $sqlMcRecorder.qml_setOperaterMode(95)
        else if(text_secret.text==="tinnu") $sqlMcRecorder.qml_setOperaterMode(100)
        else $sqlMcRecorder.qml_setOperaterMode(1)
        root.visible = false
        text_secret.text = ""
    }
}


/*##^##
Designer {
    D{i:5;anchors_width:70}
}
##^##*/
